package com.ece.control;

import java.awt.Container;
import java.util.Hashtable;

public class GeneralController {
	private static GeneralController instance;
	private static Hashtable<String, Container> viewMapping;

	public static GeneralController getInstance() {
		if(instance == null)
			instance = new GeneralController();
		return instance;
	}

	private GeneralController() {
		viewMapping = new Hashtable<String, Container>();
	}

	public Container getContainer(String name) {
		if(viewMapping.containsKey(name))
			return viewMapping.get(name);
		return null;
	}

	public void addContainer(String name, Container container) {
		if(!viewMapping.contains(container) && !viewMapping.containsKey(name))
			viewMapping.put(name, container);
	}
}
